home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / database / bltc121.zip / BORLAND.ZIP / MEMXB.ASM < prev    next >
Assembly Source File  |  1995-01-05  |  4KB  |  92 lines

  1. TITLE MEMXB
  2. PAGE 55,132
  3. ;multiple routines
  4. ;xb$malloc
  5. ;xb$free
  6. ;xb$SetHandleCount
  7. ;-----------------------------------------------------------------------|
  8. ;    ScanSoft          (C)1992 Cornel H Huth     ALL RIGHTS RESERVED    |
  9. ;-----------------------------------------------------------------------|
  10. ;     date:      30-Sep-92                                              |
  11. ; function:      memory routines                                        |
  12. ;                standard memory allocation module using DOS allocation |
  13. ;                use MEMCXB.ASM for Borland C compilers                 |
  14. ;-----------------------------------------------------------------------|
  15.  
  16.                 .MODEL LARGE,PASCAL
  17.  
  18.         .DATA
  19.         
  20. PUBLIC _maxPackRAM        ;31-Aug-93 added 
  21. PUBLIC _maxIndexToken
  22.                 
  23. ;The following max values are for compiler/run-time code that gets flakey
  24. ;on large allocations made using the patch module. See MEMCXB.ASM for more.
  25.             
  26. _maxPackRAM     dw 65504        ;max bytes PackRecords can allocate (8K-63K)
  27. _maxIndexToken  dw 2            ;max bytes Reindex can allocate
  28.                                 ;where token 0=32K, 1=64K, and 2+=128K)
  29.         
  30.                 .CODE
  31. ;-----------------------------------------------------------------------|
  32. ;     date:      31-May-92                                              |
  33. ; function:      allocate memory                                        |
  34. ;   caller:      FAR, ASSEMBLY                                          |
  35. ;    stack:      n/a                                                    |
  36. ;       in:      bx=paragraphs to allocate                              |
  37. ;      out:      NC=ax=segment of allocation                            |
  38. ;                CY=ax=8=not enough memory                              |
  39. ;                   ax=7=MCBs trashed                                   |
  40. ;     uses:      ax (return)                                            |
  41. ;    notes:      call with bx=FFFF and bx returns w/ largest block free |
  42. ;-----------------------------------------------------------------------|
  43.  
  44. xb$malloc       PROC
  45.  
  46.                 mov ah,48h
  47.                 int 21h
  48.                 ret
  49.  
  50. xb$malloc       ENDP
  51.  
  52. ;-----------------------------------------------------------------------|
  53. ;     date:      31-May-92                                              |
  54. ; function:      free allocated memory                                  |
  55. ;   caller:      FAR, ASSEMBLY                                          |
  56. ;    stack:      n/a                                                    |
  57. ;       in:      es=block to free                                       |
  58. ;      out:      NC=okay                                                |
  59. ;                CY=ax=9=invalid block                                  |
  60. ;                   ax=7=MCBs trashed                                   |
  61. ;     uses:      ax (return)                                            |
  62. ;-----------------------------------------------------------------------|
  63.  
  64. xb$free         PROC
  65.  
  66.                 mov ah,49h
  67.                 int 21h
  68.                 ret
  69.  
  70. xb$free         ENDP
  71.  
  72. ;-----------------------------------------------------------------------|
  73. ;     date:      31-May-92                                              |
  74. ; function:      set maximum handle count                               |
  75. ;   caller:      FAR, ASSEMBLY                                          |
  76. ;    stack:      n/a                                                    |
  77. ;       in:      bx=handle count                                        |
  78. ;      out:      NC=okay                                                |
  79. ;                CY=ax=error number                                     |
  80. ;     uses:      ax (return)                                            |
  81. ;-----------------------------------------------------------------------|
  82.  
  83. xb$SetHandleCount PROC
  84.  
  85.                 mov ah,67h
  86.                 int 21h
  87.                 ret
  88.  
  89. xb$SetHandleCount ENDP
  90.  
  91.                 END
  92.